package model.user;

/**
 * This class is used to keep track of user settings such as,
 * first and last name, email, gender, age and location
 */

import java.io.Serializable;
import model.user.User.Gender;

public class UserSettings implements Serializable {
	private String email;
	private String firstName;
	private String lastName;
	private Gender gender;
	private int age;
	private String location;
	
	/**
	 * Constructor, create new user settings object from specific setting fields
	 */
	public UserSettings(String email, String firstName, String lastName, Gender gender, int age, String location) {
		this.email = email;
		this.firstName = firstName;
		this.lastName = lastName;
		this.gender = gender;
		this.age = age;
		this.location = location;
	}
	
	//Getters and setters
	
	public String getEmail() {
		return email;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
	public String getFirstName() {
		return firstName;
	}
	
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	
	public String getLastName() {
		return lastName;
	}
	
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	public Gender getGender() {
		return gender;
	}
	
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public String getLocation() {
		return location;
	}
	
	public void setLocation(String location){
		this.location = location;
	}
	
	/**
	 * Sets the gender from a given string
	 * @param gender string defining the user's gender
	 */
	public void setGender(String gender){
		if(gender.contains("Male")){
			this.gender = Gender.MALE;
		} else{
			this.gender = Gender.FEMALE;
		}
	}
}
